package com.esri.core.renderer;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;

/* loaded from: classes.dex */
public class MultipartColorRamp extends ColorRamp implements List<ColorRamp> {
    private final ArrayList<ColorRamp> a;

    public MultipartColorRamp() {
        super("multipart");
        this.a = new ArrayList<>();
    }

    public MultipartColorRamp(JsonNode jsonNode) {
        super(jsonNode);
        this.a = new ArrayList<>();
        JsonNode findValue = jsonNode.findValue("colorRamps");
        if (findValue == null || !findValue.isArray()) {
            return;
        }
        Iterator<JsonNode> it = findValue.iterator();
        while (it.hasNext()) {
            JsonNode next = it.next();
            AlgorithmicColorRamp algorithmicColorRamp = "algorithmic".equals(next.findValue("type").getValueAsText()) ? new AlgorithmicColorRamp(next) : null;
            if (algorithmicColorRamp != null) {
                this.a.add(algorithmicColorRamp);
            }
        }
    }

    @Override // java.util.List, java.util.Collection
    public boolean add(ColorRamp colorRamp) {
        if (colorRamp instanceof MultipartColorRamp) {
            return false;
        }
        return this.a.add(colorRamp);
    }

    @Override // java.util.List, java.util.Collection
    public int size() {
        return this.a.size();
    }

    @Override // java.util.List, java.util.Collection
    public boolean isEmpty() {
        return this.a.isEmpty();
    }

    @Override // java.util.List, java.util.Collection
    public boolean contains(Object obj) {
        return this.a.contains(obj);
    }

    @Override // java.util.List, java.util.Collection, java.lang.Iterable
    public Iterator<ColorRamp> iterator() {
        return this.a.iterator();
    }

    @Override // java.util.List, java.util.Collection
    public Object[] toArray() {
        return this.a.toArray();
    }

    @Override // java.util.List, java.util.Collection
    public <T> T[] toArray(T[] tArr) {
        return (T[]) this.a.toArray(tArr);
    }

    @Override // java.util.List, java.util.Collection
    public boolean remove(Object obj) {
        return this.a.remove(obj);
    }

    @Override // java.util.List, java.util.Collection
    public boolean containsAll(Collection<?> collection) {
        return this.a.containsAll(collection);
    }

    @Override // java.util.List, java.util.Collection
    public boolean addAll(Collection<? extends ColorRamp> collection) {
        return this.a.addAll(collection);
    }

    @Override // java.util.List, java.util.Collection
    public boolean removeAll(Collection<?> collection) {
        return this.a.removeAll(collection);
    }

    @Override // java.util.List, java.util.Collection
    public boolean retainAll(Collection<?> collection) {
        return this.a.retainAll(collection);
    }

    @Override // java.util.List, java.util.Collection
    public void clear() {
        this.a.clear();
    }

    @Override // java.util.List
    public boolean addAll(int i, Collection<? extends ColorRamp> collection) {
        return this.a.addAll(i, collection);
    }

    @Override // java.util.List
    public ColorRamp get(int i) {
        return this.a.get(i);
    }

    @Override // java.util.List
    public ColorRamp set(int i, ColorRamp colorRamp) {
        return this.a.set(i, colorRamp);
    }

    @Override // java.util.List
    public void add(int i, ColorRamp colorRamp) {
        this.a.add(i, colorRamp);
    }

    @Override // java.util.List
    public ColorRamp remove(int i) {
        return this.a.remove(i);
    }

    @Override // java.util.List
    public int indexOf(Object obj) {
        return this.a.indexOf(obj);
    }

    @Override // java.util.List
    public int lastIndexOf(Object obj) {
        return this.a.lastIndexOf(obj);
    }

    @Override // java.util.List
    public ListIterator<ColorRamp> listIterator() {
        return this.a.listIterator();
    }

    @Override // java.util.List
    public ListIterator<ColorRamp> listIterator(int i) {
        return this.a.listIterator(i);
    }

    @Override // java.util.List
    public List<ColorRamp> subList(int i, int i2) {
        return this.a.subList(i, i2);
    }

    @Override // com.esri.core.renderer.ColorRamp
    public void toJson(JsonGenerator jsonGenerator) throws IOException, JsonGenerationException, Exception {
        super.toJson(jsonGenerator);
        jsonGenerator.writeArrayFieldStart("colorRamps");
        Iterator<ColorRamp> it = this.a.iterator();
        while (it.hasNext()) {
            jsonGenerator.writeRawValue(it.next().toJson());
        }
        jsonGenerator.writeEndArray();
    }

    @Override // com.esri.core.renderer.ColorRamp
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("MultipartColorRamp [_colorRamps=");
        ArrayList<ColorRamp> arrayList = this.a;
        sb.append(arrayList != null ? arrayList.subList(0, Math.min(arrayList.size(), 5)) : null);
        sb.append(",");
        sb.append(super.toString());
        sb.append("]");
        return sb.toString();
    }
}
